// import com.alibaba.druid.sql.ast.SQLName_ptr;
// import com.alibaba.druid.sql.ast.SQLObject;
// import com.alibaba.druid.sql.ast.SQLStatementImpl;
// import com.alibaba.druid.sql.ast.expr.SQLIdentifierExpr;
// import com.alibaba.druid.sql.visitor.SQLASTVisitor;

// import java.util.Collections;
// import java.util.List;

#include "SQLCloseStatement.h"
#include "../../visitor/SQLASTVisitor.h"
#include "../expr/SQLIdentifierExpr.h"

SQLName_ptr SQLCloseStatement::getCursorName()
{
  return cursorName;
}

void SQLCloseStatement::setCursorName(string_ptr cursorName)
{
  setCursorName(SQLIdentifierExpr_ptr(new SQLIdentifierExpr(cursorName)));
}

void SQLCloseStatement::setCursorName(SQLName_ptr cursorName)
{
  if (cursorName != nullptr)
  {
    cursorName->setParent(SharedObject(SQLCloseStatement));
  }
  this->cursorName = cursorName;
}

// @Override
void SQLCloseStatement::accept0(SQLASTVisitor_ptr visitor)
{
  if (visitor->visit(SharedObject(SQLCloseStatement)))
  {
    acceptChild(visitor, cursorName);
  }
  visitor->endVisit(SharedObject(SQLCloseStatement));
}

// @Override
SQLObject_list_ptr SQLCloseStatement::getChildren()
{
  SQLObject_list_ptr tmp = std::make_shared<std::list<SQLObject_ptr>>();
  return tmp;
}
